#include	<avr/io.h>

int	main(void)
{	
	DDRG = (DDRG & ~(1<<PG1 | 1<<PG2)) | 1<<PG0;
	PORTG = PORTG | 1<<PG1 | 1<<PG2;
	
	while(1){
		if( !(PING & 1<<PG1))	
			PORTG = PORTG | 1<<PG0;
			
		if( !(PING & 1<<PG2))	
			PORTG = PORTG & ~(1<<PG0);
	}
	
	return 0;
}
